function [data] = organize_ann(ANN, LABEL, PRED)
    blank = struct('image', '', 'bg_rects', [], 'ppl_rects', [], 'bg_pred', [], 'ppl_pred', []);
    
    data(1) = blank;
    prev = '';
    ind = 0;
    for ix = 1:length(ANN)
        if ~strcmp(ANN(ix).image, prev)
            ind = ind+1;
            prev = ANN(ix).image;
            data(ind) = blank;
            data(ind).image = ANN(ix).image;
        end
        if LABEL(ix) == 1 % pos ex
            data(ind).ppl_rects = [data(ind).ppl_rects; ANN(ix).rect];
            data(ind).ppl_pred  = [data(ind).ppl_pred;  PRED(ix)];
        else
            data(ind).bg_rects  = [data(ind).bg_rects;  ANN(ix).rect];
            data(ind).bg_pred   = [data(ind).bg_pred;   PRED(ix)];
        end
    end
end